<?php


class DataSourceManager {

	protected $confFile = "conn.xml" ; 
	protected static $connections ;

    const ENVIROMENT_LOCAL = 1;
    const ENVIROMENT_PREVIEW = 2;
    const ENVIROMENT_PRODUCTION = 3;

	const CONNECTION_DB = 1;
	const CONNECTION_FILE = 2;
	const CONNECTION_WEBSERVICE = 3;
	
	protected function __construct() {   }
    
	
	// TODO: Inne sposoby polaczenia
	public static function createConnection() { }
	
	
	public static function getAllConnections(){ }
	
    public function query( ORMBaseQuery $query ) {
        

    }
	
	// wczytywanie connectionow z pliku
	public static function addResourceConnection( $name, $resource ) {
        	
	}

	public static function listConfiguration(  ) {
	
	}
	
	public static function addNewConnection( $name, $connectionString, $user, $password, $type = CONNECTION_DB ) {
		
	}

	public static function getConnection( $name ) {
		if( isset( self::$connections[$name] ) ) return self::$connections[$name] ;
		
			
	}
}


?>
